package com.wzq.permission.center.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.wzq.permission.client.model.Pager;
import com.wzq.permission.client.model.admin.DataPermissionModel;

public interface DataPermissionMapper extends BaseMapper{
	/**
	 * 根据application 查询权限数据
	 * @param applicationId  系统id
	 * @param pager  页面
	 * @return
	 */
	List<DataPermissionModel> quaryListByApplication(@Param("model")DataPermissionModel model,@Param("pager")Pager pager);
	/**
	 * 根据application 统计数量
	 * @param applicationId  系统id
	 * @return
	 */
	int queryCountByApplication(@Param("applicationId")Long applicationId);
	
	void logicDelete(@Param("dataPermissionIds")Long[] dataPermissionIds);
	
	/**
	 * 
	 * 根据用户ID查询用户数据权限   
	 * @author 陈剑飞    
	 * @Title: queryDataPermissionByUserId    
	 * @param userId 用户ID
	 * @param applicationId 系统ID
	 * @Return: List<DataPermissionModel> 返回值
	 */
	List<DataPermissionModel> queryDataPermissionByUserId(@Param("userId")Long userId,@Param("applicationId")String applicationId);
	
	/**
     * 判断数据权限名是否存在
     * @param model 数据权限对象
     * @return int 
     */
    int isExist(DataPermissionModel model);
}
